// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   transfer.java

package include.nseer_cookie;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class transfer
{

	private String fieldA[];
	private String fieldB[];
	private String tableA;
	private String tableB;

	public transfer()
	{
		fieldA = new String[3];
		fieldB = new String[3];
		tableA = "";
		tableB = "";
	}

	public void transfer(String main, String main1, String fieldA[], String fieldB[], String tableA, String tableB, String dbA, 
			String dbB)
	{
		try
		{
			nseer_db nseerA = new nseer_db(dbA);
			nseer_db nseerB = new nseer_db(dbB);
			String sql = (new StringBuilder("select ")).append(fieldA[0]).append(",").append(fieldA[1]).append(",").append(fieldA[2]).append(" from ").append(tableA).append(" order by id").toString();
			ResultSet rs = nseerA.executeQuery(sql);
			String sql1 = "";
			for (; rs.next(); nseerB.executeQuery(sql1))
			{
				String field1 = rs.getString(fieldA[0]);
				String field2 = rs.getString(fieldA[1]);
				String field3 = rs.getString(fieldA[2]).substring(6);
				int a = field3.indexOf("/");
				field3 = field3.substring(a + 1);
				a = field3.indexOf("/");
				field3 = field3.substring(0, a);
				sql1 = (new StringBuilder("insert into  ")).append(tableB).append("(").append(fieldB[0]).append(",").append(fieldB[1]).append(",").append(fieldB[2]).append(") values ('").append(field1).append("','").append(field2).append("','").append(field3).append("')").toString();
			}

		}
		catch (Exception exception) { }
	}
}
